<?php

/**
 * 
 * @author NutMotion <simonotm.linux@gmail.com> 
 */
require_once(dirname(__FILE__) . "/../db/common-operations.php");

/*This module contains all database queries that act solely on the tags table
 * 
 */

function dbGetAllFromTags() {
    return selectFromTable2("tags", "*", null, "tag");
}

function dbGetTagsOfId($id) {
    return selectFromTable("tags", "*", "id=$id");
}


function dbCreateTag($arTagData) {
//   Here's how the final query we want to build here looks like:
//  INSERT INTO tags (tag) VALUES ($arTagData['tag'])
    $queryTable = "tags";
    $queryFields = "tag";
    $queryValues="'".mysql_real_escape_string($arTagData['tag'])."'";

    $resultContext=insertIntoTable2($queryTable, $queryFields, $queryValues);
    
    return $resultContext;  // for the moment, we don't do any error management in this function.
    
}

?>
